<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var num = parseInt(prompt("输入一个偶数"));
        isTrue(num);

        function factorial(a){
            var sum=0;
            for(var i=1;i<=a;i++){
                if(a % i ==0){
                    sum++;
                }
            }
            if(sum==2){
                return true;
            }else{
                return false;
            }
        }

        function isTrue(a){
        for(var i=2;i<a-2;i++){
            var j = a -i;
            if(factorial(i)&&factorial(j)){
                console.log(a+"可以拆分为两个质数"+ i+"与"+j+"的和");
            }
        }
        }

    </script>
</body>
</html>